package com.project.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.ProjectBean;
import com.project.bean.ProjectCountBean;
import com.project.mapper.ProjectMapper;
import com.project.service.ILogService;
import com.project.service.IProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProjectServiceImpl implements IProjectService {
    @Autowired
    private ProjectMapper mapper;
    @Override
    public PageInfo<ProjectBean> cutByItem(int pageNO, String name, String status, String order) {
        PageHelper.startPage(pageNO, IProjectService.PAGESIZE);
        PageInfo<ProjectBean> pageInfo = PageInfo.of(mapper.cutByItem(name,status,order));
        return pageInfo;
    }

    @Override
    public void add(ProjectBean project) {
        mapper.add(project);
    }

    @Override
    public ProjectBean findById(int id) {
        return mapper.findById(id);
    }

    @Override
    public List<ProjectBean> findNotFinish() {
        return mapper.findNotFinish();
    }

    @Override
    public void updateProjectStatus(int id) {
        mapper.updateProjectStatus(id);
    }
}
